var cc__decorate = __decorate;
Object.defineProperty(exports, "__esModule", {
  value: true
});
var $2UIManager = require("UIManager");
var $2BaseUIPopup = require("BaseUIPopup");
var $2UIVMain = require("UIVMain");
var cc__decorator = cc._decorator;
var ccp_ccclass = cc__decorator.ccclass;
var ccp_property = cc__decorator.property;
var def_UIPProp = /* */function (_s$default3) {
  function _ctor() {
    var _this117;
    babel_classCallCheck(this, _ctor);
    _this117 = _callSuper(this, _ctor, arguments);
    _this117.tileSprite = null;
    _this117.iconSprite = null;
    _this117.effSprite = null;
    _this117.videoBtn = null;
    _this117.closeBtn = null;
    _this117.countLbl = null;
    _this117.spriteAtlas = null;
    _this117.cb = null;
    return _this117;
  }
  babel_inherits(_ctor, _s$default3);
  return babel_createClass(_ctor, [{
    key: "onClose",
    value: function onClose() {
      this.close();
      if (this.cb) {
        this.cb(false);
        this.cb = null;
      }
    }
  }, {
    key: "onVideo",
    value: function onVideo() {
      var _this118 = this;
      $2UIManager.UIManager.getInstance().getUI($2UIVMain.default).levelPlayAD(function (e) {
        if (e && _this118.cb) {
          _this118.cb(true);
          _this118.close();
          _this118.cb = null;
        }
      });
    }
  }, {
    key: "setData",
    value: function setData(e, t, n) {
      this.tileSprite.spriteFrame = this.spriteAtlas.getSpriteFrame("title_" + e);
      this.iconSprite.spriteFrame = this.spriteAtlas.getSpriteFrame("icon_" + e);
      this.effSprite.spriteFrame = this.spriteAtlas.getSpriteFrame("eff_" + e);
      this.countLbl.string = "已使用次数:".concat(t, "/3");
      this.cb = n;
    }
  }, {
    key: "onDisable",
    value: function onDisable() {
      babel_get(babel_getPrototypeOf(_ctor.prototype), "onDisable", this).call(this);
      this.closeBtn.on("click", this.onClose, this);
      this.videoBtn.on("click", this.onVideo, this);
    }
  }, {
    key: "onEnable",
    value: function onEnable() {
      babel_get(babel_getPrototypeOf(_ctor.prototype), "onEnable", this).call(this);
      this.closeBtn.on("click", this.onClose, this);
      this.videoBtn.on("click", this.onVideo, this);
    }
  }]);
}($2BaseUIPopup.default);
def_UIPProp.className = "UIPProp";
cc__decorate([ccp_property(cc.Sprite)], def_UIPProp.prototype, "tileSprite", undefined);
cc__decorate([ccp_property(cc.Sprite)], def_UIPProp.prototype, "iconSprite", undefined);
cc__decorate([ccp_property(cc.Sprite)], def_UIPProp.prototype, "effSprite", undefined);
cc__decorate([ccp_property(cc.Node)], def_UIPProp.prototype, "videoBtn", undefined);
cc__decorate([ccp_property(cc.Node)], def_UIPProp.prototype, "closeBtn", undefined);
cc__decorate([ccp_property(cc.Label)], def_UIPProp.prototype, "countLbl", undefined);
cc__decorate([ccp_property(cc.SpriteAtlas)], def_UIPProp.prototype, "spriteAtlas", undefined);
def_UIPProp = cc__decorate([ccp_ccclass], def_UIPProp);
exports.default = def_UIPProp;